import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入 ElementPlus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入 ElementPlus 所有图标并全局注册
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入初始化样式表
import '@/assets/styles/reset.scss'
// 引入通用样式表
import '@/assets/styles/common.scss'
// 引入SvgIcons
import '@/assets/icons'
// 导入SvgIcon 组件
import SvgIcon from '@/components/SvgIcon'

const app = createApp(App)

/**
 * 完整引入
 * 备注：element-plus 支持按需引入，具体参考：https://element-plus.org/zh-CN/guide/quickstart.html
 */
app.use(ElementPlus)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 全局注册SvgIcon组件
app.component('svg-icon', SvgIcon)

app.use(store).use(router).mount('#app')
